import globals from 'globals'
import pluginJs from '@eslint/js'
import pluginVue from 'eslint-plugin-vue'

export default [
  {
    files: ['**/*.{js,mjs,cjs,vue}'],
    languageOptions: { globals: globals.browser }
  },
  pluginJs.configs.recommended,
  ...pluginVue.configs['flat/essential'],
  {
    rules: {
      'no-console': 'off',
      'no-restricted-globals': 'off',
      'no-restricted-syntax': 'off',
      'no-control-regex': 0,
      'vue/multi-word-component-names': 'off',
      'vue/no-unused-components': 0,
      'no-multiple-empty-lines': ['off', { max: 1 }],
      'vue/valid-template-root': 'off',
      'no-undef': 0,// 未定义
      'no-unused-vars': 0, // 未使用的变量
      'quotes': [2, 'single',
        {
          avoidEscape: true,
          allowTemplateLiterals: true
        }
      ]
    }
  }
]
